# 计算器业务功能类

class Caculator():

    # 加法运算
    def num_add(self, num1, num2):
        if isinstance(num1, int)  and isinstance(num2, int):
            return num1 + num2

        elif isinstance(num1, float) and isinstance(num2, float):
            return num1 + num2
        else:
            return "请输入数字！"



    # 减法运算
    def num_sub(self, num1, num2):
        return num1 - num2

    # 乘法运算
    def num_mult(self, num1, num2):
        return num1 * num2

    # 除法运算
    def num_div(self, num1, num2):
        if isinstance(num1, int) and isinstance(num2, int) and num2 not in(0, 0.0):
            return num1 / num2
    
        elif isinstance(num1, float) and isinstance(num2, float) and num2 not in(0, 0.0):
            return num1 / num2
        elif num2 in(0, 0.0):
            return "被除数不能为0！"
        else:
            return "请输入数字！"
        
        


